import express from "express";
import cors from "cors";
import connectDB from "./utils/db";
import router from "./routes/index";

const app = express();
app.use(express.json());
app.use(cors());

// 引入路由
router(app);
// 连接数据库
// await connectDB();

const PORT = process.env.PORT || 9527;
app.listen(PORT, () => {
  console.log(`http://localhost:${PORT}`);
});
